package ui;


import com.moxaic.util.Empowered;

/**
 *
 * @author Karl
 */
public class EmpoweredWorker extends Empowered {
    protected void init() {
        // Initialization code.. not necessary
    }
    
    /**
     * @pre data is a Runnable
     */
    protected void process(Object data) {
        try {
            Runnable target = (Runnable)data;
            target.run();
        } catch(ClassCastException cce) {
            cce.printStackTrace();
        }
    }
    
    protected void cleanup() {
    }
    
    public void runCode(Runnable target) {
        addData(target);
        performOp();
    }
}
